package com.example.demo.design.demo09_prototype;

import java.util.ArrayList;

/**
 * Created by 蔡超 on 2018/10/2.
 */
public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        Resume resume = new Resume();
        resume.setName("张三");
        resume.setAge(18);
        resume.setSex("男");
        ArrayList<String> list = new ArrayList<String>();
        list.add("父母");
        resume.setFamilyList(list);
        WorkExperience workExperience = new WorkExperience("2018-09-01","公司A");
        resume.setWorkExperience(workExperience);

        Resume resume1 = resume.clone();
        resume1.setName("李四");
        ArrayList<String> list1 = new ArrayList<String>();
        list1.add("兄弟");
        resume1.setFamilyList(list1);
        workExperience.setTimeArea("2018-11-01");
        resume1.setWorkExperience(workExperience);

        System.out.println("resume: " + resume);
        System.out.println("resume1: " + resume1);

        /*resume: Resume{name='张三', age=18, sex='男', familyList=[父母], workExperience=WorkExperience{timeArea='2018-11-01', company='公司A'}}
          resume1: Resume{name='李四', age=18, sex='男', familyList=[兄弟], workExperience=WorkExperience{timeArea='2018-11-01', company='公司A'}}
        */
    }
}
